package com.gemme.gemme.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.gemme.gemme.R;

public class TvLeftTvArrow extends RelativeLayout {
    private Context context;

    public TvLeftTvArrow(Context context) {
        this(context,null);
    }

    public TvLeftTvArrow(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public TvLeftTvArrow(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context = context;
        initView();
    }
    TextView leftTv;
    TextView leftTv2;
    private void initView() {
        LayoutInflater.from(context).inflate(R.layout.tv_lefttv_arrow,this);

        leftTv = findViewById(R.id.leftTv);

        leftTv2 = findViewById(R.id.leftTv2);
    }

    public TvLeftTvArrow setLeftText(String leftText){
        leftTv.setText(leftText + "");
        return this;
    }

    public TvLeftTvArrow setRightText(String rightText){
        leftTv2.setText(rightText + "");
        leftTv2.setVisibility(VISIBLE);
        return this;
    }

    public TvLeftTvArrow setRightVisble(boolean isvisble){
        if(isvisble){
            leftTv2.setVisibility(VISIBLE);
        }else{
            leftTv2.setVisibility(GONE);
        }

        return this;
    }
}
